<template>
  <div class="header">
    <div class="header-left"><span class="iconfont">&#xe604;</span></div>
    <div class="header-input">
      <span class="iconfont search-icon">&#xe62b;</span>
      <input type="text" placeholder="请输入城市名"
    class="city-search" id="city-search">
    </div>
    <router-link to="/city">
      <div class="header-right">{{this.city}}<span class="iconfont">&#xe64a;</span></div>
    </router-link>
  </div>
</template>

<script>
import { mapState } from 'vuex'
export default {
  name: 'HomeHeader',
  computed: {
    ...mapState(['city'])
  }
}
</script>

<style lang="stylus" scoped="scoped">
  @import '../../../assets/stylus/varibles.styl'
  .header
    display: flex
    // height: .86rem
    background-color: $bgColor=#00bcd4
    color: #fff
    line-height: .86rem
    font-size: .32rem
    .header-left
      width: .64rem
      float: left
      font-size: .43rem
      .iconfont
        font-size: .58rem
    .header-right
      min-width: 1.04rem
      float: right
      padding: 0 .1rem
      text-align: center
      color: #fff
      .iconfont
        font-size: .18rem
        padding-left: .1rem
    .header-input
      flex: 1
      margin-left: .2rem
      box-sizing: border-box
      // background-color: #ccc
      position: relative
      .iconfont
        font-size: .48rem
      .search-icon
        position: absolute
        top: .06rem
        left: .06rem
        color: #ccc
      .city-search
        width: 100%
        height: .60rem
        border-radius: .1rem
        padding-left:.6rem
        box-sizing: border-box
        color: #ccc
</style>
